<?php
if ($adviser_topic_validation == "")
	$adviser_topic_validation = null;
if ($owner_topic_validation == "")
	$owner_topic_validation = null;

if ($style !== null && $style != "")
	$style = " style='$style;'";
else
	$style = " style=''";
?>

<div id=<?php echo "'".$prefix."comment_layer_".$topic_id."'".$style; ?>>
	<?php

$options = array (
	'id' => $prefix . 'adviser_' . $topic_id,
	'class' => ($adviser_has_error ? $class = CHtml::$errorCss : '')
);
if ($adviser_topic_validation !== null)
	$options['disabled'] = "true";
if ($read_only)
	$options['disabled'] = "true";

echo CHtml::checkBox($form_name . "[" . $topic_id . "][adviser]", $adviser_validation, $options);
echo CHtml::label(Yii::t('project', 'Adviser validation'), $prefix . 'adviser_' . $topic_id, array (
	'style' => 'margin-right: 30px;',
	'class' => $options['class']
));

$options = array (
	'id' => $prefix . 'owner_' . $topic_id,
	'class' => ($owner_has_error ? $class = CHtml::$errorCss : '')
);
if ($owner_topic_validation !== null)
	$options['disabled'] = "true";
if ($read_only)
	$options['disabled'] = "true";

echo CHtml::checkBox($form_name . "[" . $topic_id . "][owner]", $owner_validation, $options);
echo CHtml::label(Yii::t('project', 'Owner validation'), $prefix . 'owner_' . $topic_id, array (
	'style' => 'margin-right: 30px;',
	'class' => $options['class']
));
echo "<br />";

$options = array (
	'id' => $prefix . 'comment_' . $topic_id,
	'cols' => $columns,
	'rows' => $rows,
	'class' => ($adviser_has_error || $owner_has_error) ? CHtml::$errorCss : ',',
	'style' => $area_style
);
if (!$read_only) {
	echo CHtml::textArea($form_name."[" . $topic_id . "][comment]", $comment, $options);

	$this->widget('application.extensions.jwysiwyg.JWysiwyg', array (
   'id' => $options['id'],
   'name' => $form_name."[" . $topic_id . "][comment]",
	'height'=>'100px',
	'width'=>'600px'
));
echo "<br />&nbsp;";
/*	$this->widget('application.extensions.xheditor.JXHEditor', array (
		'id' => $options['id'],
		'options' => array (
			'width' => '100%',
			'height' => 150,
			'tools' => "GStart,Blocktag,Fontface,FontSize,Bold,Italic,Underline,Strikethrough,FontColor,BackColor,GEnd,Separator,GStart,Align,List,Outdent,Indent,GEnd,Separator,GStart,About,GEnd"
		),

	));*/
}else{
	echo "<div class='editor_text' id='".$options['id']."'>".$comment."&nbsp;</div>";
}

echo CHtml::hiddenField($form_name . "[" . $topic_id . "][adviser_validation]", ($adviser_topic_validation == null) ? "" : $adviser_topic_validation, array (
	'id' => $prefix . 'adviser_validation_' . $topic_id
));
echo CHtml::hiddenField($form_name . "[" . $topic_id . "][owner_validation]", ($owner_topic_validation == null) ? "" : $owner_topic_validation, array (
	'id' => $prefix . 'owner_validation_' . $topic_id
));
?>&nbsp;
</div>